

let status={
  modalDelete:{
    isShow: false,
    isLoading: false,
    deleteId:''
  },
  addModal: {
    isShow: false,
    title: "",
    isLoading: false,
    rules: {
      name: [
        {required: true, message: '名称不能为空', trigger: 'blur'}
      ],
      type: [
        {required: true, type: 'integer', min: 1, message: '必须选择标签类型', trigger: 'blur, change'}
      ],
    }
  }
};

// 页面的数据源
let data = {
  tabList: [],
  tab: {
    id: "",
    name: "",
    type: 0,
    typeName: "",
    noSeo: false,
    description:"",
    createtime: ""
  }
};

// 和网络交互相关的参数
let params = {
  tab:{
    id:"",
    name: "",
    type: 0
  },
};

let tabTable = function (self) {
  return [
    {
      title: '序号',
      type: 'index',
      width: 100,
      align: 'center',
    },
    {
      title: '标签名称',
      align: 'center',
      key: 'name',
      minWidth: 150,
    },
    {
      title: '标签类型',
      width: 150,
      key: 'typeName',
      align: 'center'
    },
    {
      title: '创建时间',
      align: 'center',
      minWidth: 180,
      render: (h, params) => {
        return h('div', self.$tiyBJTime(params.row.createtime));
      },
    },
    {
      title: '综合操作',
      key: 'action',
      align: 'center',
      minWidth: 200,
      render: (h, params) => {
        return h('div', [
            h('Button', {
              props: {type: 'primary', size: 'small', icon: "md-create",},
              style: {marginRight: '8px'},
              on: {
                click: () => {
                  self.editTab(params.row.id);
                }
              }
            }, "编辑"),
            h('Button', {
              props: {type: 'error', size: 'small', icon: "md-trash",},
              style: {marginRight: '8px'},
              on: {
                click: () => {
                  self.deleteTab(params.row.id, params.row.name);
                }
              }
            }, '删除'),
          ]
        )
      }
    }
  ];
}

export  default  {
  tParam: params,
  tData: data,
  tabTable: tabTable,
  tStatus:status
};

